<%= render :partial => 'admin/shared/configuration_menu' %>

<h1><%= t("mail_server_settings") %></h1>


<%# TODO: move this code to a helper? %>
<div id="mail_delivery_status" class="error-or-notice">
  <%= 
    if Spree::Config[:enable_mail_delivery]
      content_tag(:h4, t('mail_delivery_enabled'))
    else
      content_tag(:h4, t('mail_delivery_not_enabled'))
    end
  %>
</div>

<table>
  <tr>
    <th scope="row"><%= t("smtp_domain") %>:</th> 
    <td><%=  Spree::Config[:mail_domain] %></td>
  </tr>
  <tr>
    <th scope="row"><%= t('smtp_mail_host') %>:</th> 
    <td><%= Spree::Config[:mail_host] %></td>
  </tr>
  <tr>
    <th scope="row"><%= t('smtp_port') %>:</th> 
    <td><%= Spree::Config[:mail_port] %></td>
  </tr>
  <tr>
    <th scope="row"><%= t('secure_connection_type')  %>:</th> 
    <td><%= Spree::Config[:secure_connection_type] %></td>
  </tr>
  <tr>
    <th scope="row"><%= t('smtp_authentication_type') %>:</th> 
    <td><%= Spree::Config[:mail_auth_type] %></td>
  </tr>

  <% unless Spree::Config[:mail_auth_type] == "none" -%>
    <tr>
      <th><%= t('smtp_username') %>:</th>
      <td><%= Spree::Config[:smtp_username] %></td>
    </tr>
    <tr>
      <th><%= t('smtp_password') %>:</th>
      <td><%= t("not_shown") unless Spree::Config[:smtp_password].blank? -%></td>
    </tr>
  <% end -%>

  <tr>
    <th><%= t('copy_all_mails_to') %>:</th>
    <td>
      <%= t('a_copy_of_all_mail_will_be_sent_to_the_following_addresses') %><br />
      <%= Spree::Config[:mail_bcc] %>
    </td>
  </tr>

</table>
<p><%= link_to_with_icon 'edit', t("edit"), edit_admin_mail_settings_path %></p>
